<div class="middle surface-shaded">
  <div class="middle-content">
    <div class="container-fluid">
      <div class="row">
        <div class="col-md-10">
          <breadcrumbs breadcrumbs="breadcrumbs"></breadcrumbs>
          <div ng-show="!containers.length" class="mar-top-md">Loading...</div>
          <form ng-show="containers.length" name="form" class="health-checks-form" novalidate>
            <h1>Health Checks: {{name}}</h1>
            <div class="help-block">
              Container health is periodically checked using readiness and liveness probes.
              <div class="learn-more-block">
                <a href="{{'application_health' | helpLink}}" target="_blank">Learn More&nbsp;<i class="fa fa-external-link" aria-hidden="true"></i></a>
              </div>
            </div>
            <fieldset ng-disabled="disableInputs">
              <div ng-repeat="container in containers">
                <h2 ng-if="containers.length > 1">Container {{container.name}}</h2>
                <h3>Readiness Probe</h3>
                <div class="help-block mar-bottom-md" ng-if="$first">
                  A readiness probe checks if the container is ready to handle requests. A
                  failed readiness probe means that a container should not receive any traffic
                  from a proxy, even if it's running.
                </div>
                <div ng-if="!container.readinessProbe">
                  <a href="" ng-click="addProbe(container, 'readinessProbe')">Add Readiness Probe</a>
                </div>
                <div ng-if="container.readinessProbe">
                  <edit-probe
                      probe="container.readinessProbe"
                      exposed-ports="container.ports"
                      ng-if="container.readinessProbe">
                  </edit-probe>
                  <p>
                    <a href="" ng-click="removeProbe(container, 'readinessProbe')">Remove Readiness Probe</a>
                  </p>
                </div>
                <h3>Liveness Probe</h3>
                <div class="help-block mar-bottom-md" ng-if="$first">
                  A liveness probe checks if the container is still running. If the liveness
                  probe fails, the container is killed.
                </div>
                <div ng-if="!container.livenessProbe">
                  <a href="" ng-click="addProbe(container, 'livenessProbe')">Add Liveness Probe</a>
                </div>
                <div ng-if="container.livenessProbe">
                  <edit-probe
                      probe="container.livenessProbe"
                      exposed-ports="container.ports">
                  </edit-probe>
                  <p>
                    <a href="" ng-click="removeProbe(container, 'livenessProbe')">Remove Liveness Probe</a>
                  </p>
                </div>
              </div>

              <pause-rollouts-checkbox
                  ng-if="object | managesRollouts"
                  deployment="object">
              </pause-rollouts-checkbox>

              <div class="button-group gutter-top gutter-bottom">
                <button type="submit"
                  class="btn btn-primary btn-lg"
                  ng-click="save()"
                  ng-disabled="form.$invalid || form.$pristine || disableInputs"
                  value="">Save</button>
                <button class="btn btn-default btn-lg" ng-click="cancel()">Cancel</button>
              </div>
            </fieldset>
          </form>
        </div>
      </div>
    </div>
  </div><!-- /middle-content -->
</div><!-- /middle -->
